package com.zmn.oms.admin.converter;

import org.apache.commons.lang3.StringUtils;
import org.springframework.core.convert.converter.Converter;

import java.time.YearMonth;

/**
 * 年月转换器
 *
 * @author hankangshuai
 * @date 2019-10-25
 */
public class YearMonthConverter implements Converter<String, YearMonth> {
    @Override
    public YearMonth convert(String text) {
        if (StringUtils.isBlank(text)) {
            return null;
        }
        return YearMonth.parse(text);
    }
}
